package com.demo.netty.config;

import com.demo.netty.protocol.CustomProtocol;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author liangliang
 */
@Configuration
public class HeartBeatConfig {

    @Value("${channel.id}")
    private long id;

    @Bean("heartBeat")
    public CustomProtocol heartBeat(){
        return new CustomProtocol(id,"ping");
    }
}
